﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="EditArticle.aspx.cs" Inherits="EditArticle" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 <script type="text/javascript">
     $(function () {
         function getdata() {
             var id = darren.getQueryString(location.href, "pid");
             var result = SixLottery.Models.Article.GetDetail(id);
             if (result.ErrorCode > 0)
                 return result.Value;
             else
                 alert("加载失败：" + result.Message);
         }
         darren.form({
             appendTo: $(".form2"),
             title: "添加产品",
             data: getdata(),
             url: "",
             width: 900,
             items: [
                { id: "Id", label: "ID", type: "hidden", required: true, width: 700 },
				{ id: "Title", label: "标题", type: "textbox", required: true, width: 700 },
                { id: "Content", label: "内容", type: "editor", required: true, width: 700, height: 400 },
                { id: "submit", label: "修改", type: "submit", iconCls: "icon-save", url: "",
                    onClick: function (isValid, formData) {
                        SixLottery.Models.Article.Update(formData, { success: function (result) {
                            if (result.ErrorCode == 0) {
                                alert("修改成功!");
                            } else {
                                alert("修改失败：" + result.Description);
                            }
                        }
                        });
                    },
                    success: function (isValid, data) {
                        success(data);
                    },
                    onLoadError: function () {
                    }
                }
                ]
         });
     });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <div class="form2">
    </div>
    
</asp:Content>

